package ch3;

public class TestNumSort {
	
	public static void main(String [] args) {
		int [] a = {1, 3, 5, 9, 7, 8, 6, 2, 4};
		print(a);
		sort(a);
		print(a);
		int [] b;
		b = new int[10];
		for(int i = 0 ; i < b.length; i++) {
			b[i] = i;
		}
	}
	
	public static void print(int [] a ) {
		for(int i = 0; i < a.length; i++) {
			System.out.print(a[i] + " ");
		}
	}
	
	public static void sort(int [] a ) {
		System.out.println();
		for(int i = 0; i < a.length; i++) {
			for (int j = i + 1; j < a.length; j++) {
				if(a[i] > a[j]) {
					int temp = a[i];
					a[i] = a[j];
					a[j] = temp;
				}
			}
		}
	}
	
}
